package com.xz.http.instance;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;

/**
 * Created by YLZX-Z0107 on 2014/7/16.
 */
public class HttpFactory {

    private HttpFactory() {
        System.out.println("HttpFactory create");
    }

    private static class GetHolder {
        private static HttpGet get = new HttpGet();
    }

    private static class PostHolder {
        private static HttpPost post = new HttpPost();
    }

    public static HttpGet getMethod() {
        HttpGet get = GetHolder.get;
        get.addHeader("Accept", "text/html");
        get.addHeader("Accept-Charset", "utf-8");
        get.addHeader("Accept-Encoding", "gzip");
        get.addHeader("Accept-Language", "en-US,en");
        get.addHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22");
        return get;
    }
}
